package com.situ.day12Pingfang;

import java.util.Scanner;

public class PingFang {
	public void Pingfang() throws PingFangException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			System.out.println("请输入要开方的数");
			int shu = scanner.nextInt();
			if (shu >= 0) {
				Double jieGuo = Math.sqrt(shu);
				System.out.println(jieGuo);
			} else{
				throw new PingFangException(shu);
			}
			
		}
	}
}
